﻿using Guest_room.BLL;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Guest_room
{
    public partial class Register : Form
    {
        public Register()
        {
            InitializeComponent();
        }

        GuestRoomService guestRoomService = new GuestRoomService();
        private void button1_Click(object sender, EventArgs e)
        {
            string userType = radioButton1.Checked ? "管理员" : "普通员工";
            string resultMessage = guestRoomService.RegisterUser(textBox1.Text, textBox2.Text, textBox3.Text, userType);
            MessageBox.Show(resultMessage);
            if (resultMessage == "注册成功！")
            {
                this.Close();
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
